package main

import "fmt"

func main() {
	a := [...]int{1, 2, 3, 4, 5, 6, 7, 8, 9}
	b := a[2:8]
	fmt.Println(a)
	change(b)
	fmt.Println(cap(b))
	fmt.Println(a)

	for i := 10; i < 20; i++ {
		b = append(b, i)
		fmt.Printf("cap=%d \t %s\n", cap(b), b)
	}
}

func change(s []int) {
	fmt.Println(s)
	if len(s) > 0 {
		s[0] = 10
	}
	_ = append(s, 11)
	fmt.Println(s)
}
